home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Apr 89 / T0028-Re Segmentation cha-Apr89 < prev    next >
Encoding:
Text File  |  1989-04-19  |  1.6 KB  |  39 lines  |  [TEXT/GEOL]

  1. Item    2386582                         19-April-89        02:07
  2.  
  3. From:   ROLLIN1                         Rollin, Keith A.
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. Sub:    Re- Segmentation changes?
  8.  
  9.  
  10. >Would it be feasible to change some of the more commonly used routines such as
  11. >TStaticText.SetText to be resident so that one could pass a string field of an
  12. >object without first copying it into a local string?  Regards, Les Caudle
  13.  
  14. I'm afraid that making a program segment resident won't help you here, Les.
  15.  
  16. In a way, you can consider that an object is divided into two parts: its data
  17. and its methods. The methods are the actual procedures that get executed, and
  18. are stored in CODE segments. It is these CODE segments that get locked down
  19. when you make something resident.
  20.  
  21. The data for each object (its "instance variables") are stored in blocks of
  22. memory referenced by the object's handle. It is this block of data that tends
  23. to move around when memory shuffling goes on, and causes one to have to copy
  24. certain instance variables into local variables. Making a CODE segment resident
  25. does not have any effect on the object handle's nomadic tendancies.
  26.  
  27. One thing that you *COULD* do is call SELF.Lock before calling a procedure that
  28. needs a string (or similar) parameter and that can cause memory to be moved.
  29. However, IT IS VERY IMPORTANT THAT YOU RESTORE THE HANDLE'S PREVIOUS LOCKED
  30. SETTING AFTERWARDS! I'm sorry if I'm preaching to the converted on this issue,
  31. but it's very easy for memory fragmentation to screw up MacApp's memory
  32. management system.
  33.  
  34. I hope this helps,
  35.  
  36. - Keith Rollin
  37. - Apple Developer Technical Support
  38.  
  39.